///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar  6 2009)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "paneltaskgui.h"

#include "res/edit_add.xpm"
#include "res/edit_del.xpm"
#include "res/finish.xpm"
#include "res/work.xpm"

// Using the construction of a static object to ensure that the help provider is set
class wxFBContextSensitiveHelpSetter
{
public:
wxFBContextSensitiveHelpSetter()
{
wxHelpProvider::Set( new wxSimpleHelpProvider );
}
};

static wxFBContextSensitiveHelpSetter s_wxFBSetTheHelpProvider;
///////////////////////////////////////////////////////////////////////////

PanelTaskGui::PanelTaskGui( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxVERTICAL );
	
	m_toolbar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL ); 
	m_toolbar->AddTool( ID_PM_ADD_TASK, wxEmptyString, wxBitmap( edit_add_xpm ), wxNullBitmap, wxITEM_NORMAL, _("Add new task"), wxEmptyString );
	m_toolbar->AddTool( ID_PM_WORK_ON_TASK, wxEmptyString, wxBitmap( work_xpm ), wxNullBitmap, wxITEM_NORMAL, _("Work on a task"), wxEmptyString );
	m_toolbar->AddTool( ID_PM_FINISH_TASK, wxEmptyString, wxBitmap( finish_xpm ), wxNullBitmap, wxITEM_NORMAL, _("Finnish the task"), wxEmptyString );
	m_toolbar->AddSeparator();
	m_toolbar->AddTool( ID_PM_DEL_TASK, wxEmptyString, wxBitmap( edit_del_xpm ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
	m_toolbar->Realize();
	
	bSizer1->Add( m_toolbar, 0, wxEXPAND, 5 );
	
	m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
	m_splitter->SetMinimumPaneSize( 60 );
	m_splitter->Connect( wxEVT_IDLE, wxIdleEventHandler( PanelTaskGui::m_splitterOnIdle ), NULL, this );
	m_panelTodo = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer2;
	bSizer2 = new wxBoxSizer( wxVERTICAL );
	
	wxStaticText* m_staticText1;
	m_staticText1 = new wxStaticText( m_panelTodo, wxID_ANY, _("Todo"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	bSizer2->Add( m_staticText1, 0, wxALL|wxEXPAND, 5 );
	
	m_listTaskTodo = new wxListCtrl( m_panelTodo, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
	bSizer2->Add( m_listTaskTodo, 1, wxEXPAND, 5 );
	
	m_panelTodo->SetSizer( bSizer2 );
	m_panelTodo->Layout();
	bSizer2->Fit( m_panelTodo );
	m_panelDone = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer21;
	bSizer21 = new wxBoxSizer( wxVERTICAL );
	
	wxStaticText* m_staticText11;
	m_staticText11 = new wxStaticText( m_panelDone, wxID_ANY, _("Done"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText11->Wrap( -1 );
	bSizer21->Add( m_staticText11, 0, wxALL|wxEXPAND, 5 );
	
	m_listTaskDone = new wxListCtrl( m_panelDone, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
	bSizer21->Add( m_listTaskDone, 1, wxEXPAND, 5 );
	
	m_panelDone->SetSizer( bSizer21 );
	m_panelDone->Layout();
	bSizer21->Fit( m_panelDone );
	m_splitter->SplitHorizontally( m_panelTodo, m_panelDone, 0 );
	bSizer1->Add( m_splitter, 1, wxEXPAND, 5 );
	
	this->SetSizer( bSizer1 );
	this->Layout();
	
	// Connect Events
	this->Connect( ID_PM_ADD_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnAddTask ) );
	this->Connect( ID_PM_WORK_ON_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnWorkOnTask ) );
	this->Connect( ID_PM_FINISH_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnFinishTask ) );
	this->Connect( ID_PM_DEL_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnDelTask ) );
	m_listTaskTodo->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
	m_listTaskTodo->Connect( wxEVT_MOTION, wxMouseEventHandler( PanelTaskGui::OnMouseMotion ), NULL, this );
	m_listTaskDone->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
}

PanelTaskGui::~PanelTaskGui()
{
	// Disconnect Events
	this->Disconnect( ID_PM_ADD_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnAddTask ) );
	this->Disconnect( ID_PM_WORK_ON_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnWorkOnTask ) );
	this->Disconnect( ID_PM_FINISH_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnFinishTask ) );
	this->Disconnect( ID_PM_DEL_TASK, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( PanelTaskGui::OnDelTask ) );
	m_listTaskTodo->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
	m_listTaskTodo->Disconnect( wxEVT_MOTION, wxMouseEventHandler( PanelTaskGui::OnMouseMotion ), NULL, this );
	m_listTaskDone->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( PanelTaskGui::OnItemActivated ), NULL, this );
}

DlgWorkOnTaskGui::DlgWorkOnTaskGui( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxVERTICAL );
	
	wxFlexGridSizer* fgSizer1;
	fgSizer1 = new wxFlexGridSizer( 2, 2, 0, 0 );
	fgSizer1->AddGrowableCol( 1 );
	fgSizer1->SetFlexibleDirection( wxBOTH );
	fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	wxStaticText* m_staticText6;
	m_staticText6 = new wxStaticText( this, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText6->Wrap( -1 );
	fgSizer1->Add( m_staticText6, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_editName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer1->Add( m_editName, 0, wxALL|wxEXPAND, 5 );
	
	wxStaticText* m_staticText3;
	m_staticText3 = new wxStaticText( this, wxID_ANY, _("Quantity"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText3->Wrap( -1 );
	fgSizer1->Add( m_staticText3, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_editQuantity = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_editQuantity->SetValidator( wxTextValidator( wxFILTER_NUMERIC, &m_sQuantity ) );
	
	fgSizer1->Add( m_editQuantity, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	wxStaticText* m_staticText4;
	m_staticText4 = new wxStaticText( this, wxID_ANY, _("Unit cost"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	fgSizer1->Add( m_staticText4, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_editUnitCost = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_editUnitCost->SetValidator( wxTextValidator( wxFILTER_NUMERIC, &m_sUnitCost ) );
	
	fgSizer1->Add( m_editUnitCost, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	wxStaticText* m_staticText5;
	m_staticText5 = new wxStaticText( this, wxID_ANY, _("Date"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText5->Wrap( -1 );
	fgSizer1->Add( m_staticText5, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_dpDate = new wxDatePickerCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN );
	fgSizer1->Add( m_dpDate, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
	bSizer4->Add( fgSizer1, 1, wxEXPAND, 5 );
	
	m_cbRemoveFromTodo = new wxCheckBox( this, wxID_ANY, _("Remove from todo"), wxDefaultPosition, wxDefaultSize, 0 );
	m_cbRemoveFromTodo->SetValue(true); 
	bSizer4->Add( m_cbRemoveFromTodo, 0, wxALL|wxEXPAND, 5 );
	
	m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	bSizer4->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
	
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxHORIZONTAL );
	
	m_btnOK = new wxButton( this, wxID_ANY, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
	m_btnOK->SetDefault(); 
	bSizer5->Add( m_btnOK, 0, wxALL, 5 );
	
	m_btnCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer5->Add( m_btnCancel, 0, wxALL, 5 );
	
	bSizer4->Add( bSizer5, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
	
	this->SetSizer( bSizer4 );
	this->Layout();
	bSizer4->Fit( this );
	
	// Connect Events
	m_btnOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DlgWorkOnTaskGui::OnSubmit ), NULL, this );
}

DlgWorkOnTaskGui::~DlgWorkOnTaskGui()
{
	// Disconnect Events
	m_btnOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DlgWorkOnTaskGui::OnSubmit ), NULL, this );
}
